package com.gopay.bis.service.bank;

import com.gopay.common.domain.bank.BankAuthOrder;
import com.gopay.common.domain.bank.BaseMessage;
import com.gopay.common.domain.bank.ExPayBaseMessage;
import com.gopay.common.exception.GopayException;

/**
 * 委托代收认证主订单Service 
 * 
 * @ClassName: BankAuthOrderService 
 * @author w_jiqing 
 * @date 2017年1月12日 下午1:41:36  
 */ 
public interface BankAuthOrderService {
    
    /** 
     * 新增认证主订单
     * @param base
     * @return
     * @throws GopayException 
     */
    public BankAuthOrder addBankAuthOrder(BaseMessage base) throws GopayException;
    
    /** 
     * 通过国付宝订单号更新银行订单号 
     * @param base
     * @return
     * @throws GopayException 
     */
    public int updateAuthBankOrderIdbyOrderId(BaseMessage base)throws GopayException;
    
    /**
     * 通过鉴权缓存表鉴权通过新增一条订单
     * @param base
     * @return
     * @throws GopayException 
     */
    public BankAuthOrder addBankAuthOrderSuccess(BaseMessage base)throws GopayException;
    
    /** 
     * 更新认证主订单--认证通过
     * @param orderId
     * @return 
     */
    public int updateBackSuccess (BaseMessage base)throws GopayException;
    
    /** 
     * 更新认证主订单--认证不通过 
     * @param orderId
     * @return 
     */
    public int updateBackFail (BaseMessage base)throws GopayException;
    
    /** 
     * 跟新认证主订单--自动对单认证通过 
     * @param orderId
     * @return 
     */
    public int updateAutoQuerySuccess (BaseMessage base)throws GopayException;
    
    /** 
     * 跟新认证主订单--自动对单认证不通过 
     * @param orderId
     * @return 
     */
    public int updateAutoQueryFail (BaseMessage base)throws GopayException;
    
    /** 
     * 更新认证主订单状态--认证失败
     * @param orderId
     * @return 
     */
    public int updateBackVerifyFail (BaseMessage base)throws GopayException;
    
    /**
     * 通过签约流水表查询该卡鉴权状态，已鉴权并且要素匹配，返回TRUE；其余返回false
     * @param base
     * @return 
     */
    public boolean checkCardCer(ExPayBaseMessage base)throws GopayException;
    
    /**
     * 根据银行订单号获取认证流水
     * 
     * @param bankOrderId
     * @return
     */
    public BankAuthOrder getAuthBankOrderByBankId(String bankOrderId);

}
